<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateFreezeBalance extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mybank_balance_unfreeze_record', function (Blueprint $table) {
            $table->id();

            $table->string('merchantId', 64)->default('')->comment('商户号');
            $table->unsignedBigInteger('withholdId')->default(0)->comment('协议代扣记录表 ID');
            $table->unsignedBigInteger('outTradeNo')->default(0)->comment('代扣业务订单号(外部流水号)');
            $table->string('operateNo', 64)->default('')->comment('operateNo');
            $table->string('accountType', 32)->default(0)->comment('账号类型');
            $table->unsignedInteger('amount')->default(0)->comment('解冻金额');
            $table->string('currency', 3)->default('')->comment('币种');
            $table->unsignedInteger('status')->default(0)->comment('状态 1 已提交申请 2 成功 3 失败');
            $table->unsignedInteger('submitDateTime')->default(0)->comment('交易提交时间');
            $table->unsignedInteger('finishDateTime')->default(0)->comment('交易完结时间');
            $table->string('errorCode', 32)->default('')->comment('FAIL 错误码');
            $table->string('errorDesc', 32)->default('')->comment('错误描述');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('更新时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('更新人');
            $table->tinyInteger("isDeleted")->default(0)->comment("是否删除,0:未删除,1:已删除");

            $table->comment = '网商余额解冻记录';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('mybank_balance_unfreeze_record');
    }
}
